<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        /* 
        作用域：指的就是变量的有效范围 
                在局部和全局有相同变量的情况下
        */

        var num = 100;
        var num = 200; //后加载的

        function fun1(){
            var num = 300;
            console.log(num)
        }
        console.log(num)
        fun1();
    </script>
</head>
<body>
    
</body>
</html>